package com.wzy.peopleManagement.commond
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.wzy.peopleManagement.business.UserDeledate;
	import com.wzy.peopleManagement.event.DeleteUserByIdEvent;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;

	public class DeleteUserByIdCommond implements IResponder, ICommand
	{
		private var tw : *;
		public function DeleteUserByIdCommond()
		{
		}

		public function result(data:Object):void
		{
			var objTemp : Object = Object(data.result);
			if(objTemp.SORF == "true") {
				tw.refresh("delete",null);
				Alert.show("删除成功");
			}
		}
		
		public function fault(info:Object):void
		{
		}
		
		public function execute(event:CairngormEvent):void
		{
			var e : DeleteUserByIdEvent = DeleteUserByIdEvent(event);
			var deleDate : UserDeledate = new UserDeledate(this);
			tw = e.vo.tw;
			deleDate.deleteUserById(e.vo.userId);
		}
		
	}
}